package com.nl.lib_project.datas

import com.nl.lib_core.tool.EnvironmentUtil
import com.nl.lib_project.BuildConfig

/** 作者:LiBW 创建日期:2022/5/25 描述:接口路径统一管理类 */
object NetworkPathConstants {
  var apiVersion: String = ""
  var key: String = ""
  /** 获取系统信息 */
  fun appInfoApi(): String {
    return "api/pe/app/info/${BuildConfig.clientId}?versionCode=${EnvironmentUtil.getAppVersionCode()}"
  }

  /** 检测app更新 */
  fun updateApkApi(): String {
    return "api/app/update/last?versionCode=${EnvironmentUtil.getAppVersionCode()}&clientId=${BuildConfig.clientId}"
  }

  /** 获取首页菜单 */
  fun rootMenuApi(): String {
    return "api/pe/app/${apiVersion}/scales"
  }

  /** 新建量表问卷 */
  fun createScaleApi(scaleName: String): String {
    return "api/pe/app/${apiVersion}/evaluation-reports/start?scaleId=${scaleName}"
  }

  /** 通过高德服务器获取地址 */
  fun getAddressByGaoDe(province: String?): String {
    return "https://restapi.amap.com/v3/config/district?key=${key}&keywords=${province}&subdistrict=1&extensions=base"
  }
  /** 通过题目ID获取题目 */
  fun getQuestionByIdApi(scaleId: String, questionId: Int): String {
    return "api/pe/app/${apiVersion}/scales/${scaleId}/questions/${questionId}"
  }

  /** 获取结果页面信息 */
  fun getResultPageApi(): String {
    return "api/pe/app/${apiVersion}/evaluation-reports/result"
  }

  /** 提交用户信息 */
  fun postUserInfoApi(scaleId: String): String {
    return "api/pe/app/${apiVersion}/evaluation-reports/subjects-info?scaleId=${scaleId}"
  }

  /** 提交答题时用户面部照片 */
  fun updateFacePicApi(questionId: Int): String {
    return "api/pe/app/${apiVersion}/face-emotion?questionId=${questionId}"
  }
  /** 提交问卷单题答案 */
  fun upLoadQuestionRecordApi(scaleName: String): String {
    return "api/pe/app/${apiVersion}/evaluation-reports/question-record?scaleId=${scaleName}"
  }

  /** 获取省份(高德) */
  fun addressGetProvinceCodeApi(province: String): String {
    return "https://restapi.amap.com/v3/config/district?keywords=${province}&subdistrict=0&key=${key}"
  }

  /** 根据Ip获取位置 */
  fun appAddressApi(): String {
    return "https://restapi.amap.com/v3/ip?key=${key}"
  }

  /** 私有服务器测试 */
  fun serverPingApi(): String {
    return "/api/pe/app/ping"
  }
}
